import React, { Suspense } from "react";
import { Redirect, Route, Switch } from "react-router-dom";
import route from "./route";
export default function RouterComponent() {
    return (
        <Suspense fallback={<div>加载中。。。</div>}>
            <Switch>
                <Redirect from="/" to="/one" exact></Redirect>
                {route.map((item, index) => <Route key={index} path={item.path} component={item.component}></Route>)}
            </Switch>
        </Suspense>
    )
}
